import { ADDPERSON } from '../actionType/person.action.type'

const initialState = {
  person: [
    {
      id: 1,
      name: 'zhangsan'
    }
  ]
}

export default (state = initialState, action) => {
  console.log(action)
  switch (action.type){
    case ADDPERSON: 
       return {
         person: [
           ...state.person,
           action.payload
         ]
       }
    default: 
      return state
  }
}